home *** CD-ROM | disk | FTP | other *** search
- /* Dispatcher.c */
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
-
- #include "GadgetsApp.h"
- #include "GadgetsDoc.h"
- #include "GadgetsEngine.h"
- #include "Buttons.h"
- #include "TabbedPanel.h"
- #include "EditText.h"
- #include "AboutDialog.h"
-
- #include "Globals.h"
- #include "Dispatcher.h"
-
- /*----------*/
- void DoIdle (void)
- {
- }
-
- //----------
- // windows
-
- //----------
- void Close (
- AMWindow* window)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_Close ((Buttons*) window);
- break;
- case classTabbedPanel:
- TabbedPanel_Close ((TabbedPanel*) window);
- break;
- case classEditText:
- EditText_Close ((EditText*) window);
- break;
- } // switch
- }
-
- //----------
- void DoTrack (
- AMWindow* window,
- ControlHandle whichControl,
- short whichPart,
- Point where)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_Track ((Buttons*) window, whichControl, whichPart, where);
- break;
- case classTabbedPanel:
- TabbedPanel_Track ((TabbedPanel*) window, whichControl, whichPart, where);
- break;
- case classEditText:
- EditText_Track ((EditText*) window, whichControl, whichPart, where);
- break;
- } // switch
- }
-
- //----------
- void MouseIn (
- AMWindow* window,
- Point where,
- short modifiers)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_MouseIn ((Buttons*) window, where, modifiers);
- break;
- case classTabbedPanel:
- TabbedPanel_MouseIn ((TabbedPanel*) window, where, modifiers);
- break;
- case classEditText:
- EditText_MouseIn ((EditText*) window, where, modifiers);
- break;
- } // switch
- }
-
- //----------
- void TypeIn (
- AMWindow* window,
- char ch)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_TypeIn ((Buttons*) window, ch);
- break;
- case classTabbedPanel:
- TabbedPanel_TypeIn ((TabbedPanel*) window, ch);
- break;
- case classEditText:
- EditText_TypeIn ((EditText*) window, ch);
- break;
- } // switch
- }
-
- //----------
- void Resize (
- AMWindow* window)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_Resize ((Buttons*) window);
- break;
- case classTabbedPanel:
- TabbedPanel_Resize ((TabbedPanel*) window);
- break;
- case classEditText:
- EditText_Resize ((EditText*) window);
- break;
- } // switch
- }
-
- //----------
- void Scroll (
- AMWindow* window,
- short newValue,
- short oldValue)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_Scroll ((Buttons*) window, newValue, oldValue);
- break;
- case classTabbedPanel:
- TabbedPanel_Scroll ((TabbedPanel*) window, newValue, oldValue);
- break;
- case classEditText:
- EditText_Scroll ((EditText*) window, newValue, oldValue);
- break;
- } // switch
- }
-
- //----------
- Boolean DoCommand (
- AMWindow* window,
- long inCommand)
- {
- switch (GetClassID (window)) {
- case classButtons:
- return Buttons_DoCommand ((Buttons*) window, inCommand);
- break;
- case classTabbedPanel:
- return TabbedPanel_DoCommand ((TabbedPanel*) window, inCommand);
- break;
- case classEditText:
- return EditText_DoCommand ((EditText*) window, inCommand);
- break;
- } // switch
- return false;
- }
-
- //----------
- void ExitCurField (
- AMWindow* window)
- {
- switch (GetClassID (window)) {
- case classButtons:
- Buttons_ExitCurField ((Buttons*) window);
- break;
- case classTabbedPanel:
- TabbedPanel_ExitCurField ((TabbedPanel*) window);
- break;
- case classEditText:
- EditText_ExitCurField ((EditText*) window);
- break;
- } // switch
- }
-
- //----------
- void DataChanged (
- AMResponder* responder,
- long inDataID)
- {
- switch (GetClassID (responder)) {
- case classButtons:
- Buttons_DataChanged ((Buttons*) responder, inDataID);
- break;
- case classTabbedPanel:
- TabbedPanel_DataChanged ((TabbedPanel*) responder, inDataID);
- break;
- case classEditText:
- EditText_DataChanged ((EditText*) responder, inDataID);
- break;
- case classAboutDialog:
- AboutDialog_DataChanged ((AboutDialog*) responder, inDataID);
- break;
- } // switch
- }
-
- //----------
- // dialogs
-
- //----------
- void FinishMake (
- AMDialog* dialog)
- {
- switch (GetClassID (dialog)) {
- case classAboutDialog:
- AboutDialog_FinishMake ((AboutDialog*) dialog);
- break;
- } // switch
- }
-
- //----------
- void ConnectToData (
- AMDialog* dialog,
- AMSignaler* inData)
- {
- switch (GetClassID (dialog)) {
- case classAboutDialog:
- AboutDialog_ConnectToData ((AboutDialog*) dialog, inData);
- break;
- } // switch
- }
-
- //----------
- void DoItem (
- AMDialog* dialog,
- SInt16 inItemHit)
- {
- switch (GetClassID (dialog)) {
- case classAboutDialog:
- AboutDialog_DoItem ((AboutDialog*) dialog, inItemHit);
- break;
- } // switch
- }
-
- //----------
- Boolean Filter (
- AMDialog* dialog,
- EventRecord *ioEvent,
- DialogItemIndex *outItemHit)
- {
- switch (GetClassID (dialog)) {
- case classAboutDialog:
- return AboutDialog_Filter ((AboutDialog*) dialog, ioEvent, outItemHit);
- break;
- } // switch
- return false; // not filtered => Dialog Manager takes it
- }
-
- //----------
- // modeless dialogs
-
- /*----------*/
- void InitModelessDialogs (void)
- {
-
- }
-
- /*----------*/
- void CloseModelessDialog (
- DialogPtr whichDialog)
- {
-
- }
-